{extends file='layout/admin.html'}

{block name='title'}特危险 CMS{/block}

{block name='content'}


<form action="admin/comment_manage" method="get">
<input type="hidden" name="ids" />
<div class="clearfix sub_nav">
	<input type="text" class="input_text w290" name="q" value="{$smarty.get.q}" />
	<input type="hidden" name="recycle" value="{$smarty.get.recycle}" />
	
	<input type="submit" class="btn" value="Search" />
</div>
</form>
<div style="text-align:right;">
	{if $smarty.get.recycle}
	<input type="button" class="btn" value="返回评论管理" onclick="window.location.href='admin/comment_manage'" />
	{else}
	<input type="button" class="btn" value="垃圾箱" onclick="window.location.href='admin/comment_manage?recycle=1'" />
	{/if}
</div>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="content_table">
	<thead>
		<tr style="height: 30px;">
			<th class="center" style="border-left: 1px solid #CCC; width: 15%; line-height: 30px;width: 5%;"></th>
			<th class="center" style="border-left: 1px solid #CCC; width: 15%; line-height: 30px;width: 45%;">内容</th>
			<th style="border-left: 1px solid #CCC; width: 10%; line-height: 30px;">
				<a href="{$smarty.const.SITE_URL}/admin/comment_manage?t={if $smarty.get.t == 'DESC'}ASC{else}DESC{/if}">创建时间</a></th>
			<th style="border-left: 1px solid #CCC; width: 15%; line-height: 30px;">创建人</th>
			<th class="right" style="border-left: 1px solid #CCC; width: 15%; line-height: 30px;" >操作</th>
		</tr>
	</thead>
	{if $smarty.get.recycle}
	<form action="admin/comment_manage/truedelete" method="post" id="comment_manage">
	{else}
	<form action="admin/comment_manage/delRevielw" method="post" id="comment_manage">
	{/if}
	<tbody class="text_indent">
		{foreach $data as $val}
		{if $val@iteration % 2}<tr>{else}<tr class="odd" style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #EEE; background-position: initial initial; background-repeat: initial initial; ">{/if}
		    <td><input type="checkbox" name="id[]" value="{$val.id}"></td>
			<td><a href="admin/comment_manage/revielwRead?id={$val.id}">{substr_fix($val.content, 25)}</a></td>
			<td style="border-right-style: none; border-right-width: initial; border-right-color: initial;">{date('Y/m/d', $val.add_time)}</td>
			<td style="border-right-style: none; border-right-width: initial; border-right-color: initial;">{get_info('user', $val.user_id, 'name')}</td>
			<td style="border-right-style: none; border-right-width: initial; border-right-color: initial; text-align: center;">
				<a href="#">Select Actions <img src="images/i.gif" alt="Action menu" class="arrow" /></a>
				<div class="action_btn" style="display: none;">
					<ul class="action_menu">
						{if $smarty.get.recycle}
							<li><a href="admin/comment_manage/redelete?id={$val.id}">还原</a></li>
							<li><a href="admin/comment_manage/truedelete?id={$val.id}" class="delete">彻底删除</a></li>
						{else}
						<li><a href="admin/comment_manage/revielwRead?id={$val.id}">编辑</a></li>
						<li><a href="admin/comment_manage/delRevielw?id={$val.id}" class="delete">删除</a></li>
						{/if}
					</ul>
				</div>
			</td>
		</tr>
		{/foreach}
	</tbody>
</table>
<div class="clearfix sub_nav">
{include file="lib/admin_pager.html"}
<input id="all" value="全选" type="checkbox" >全选
<span class="btn fr">
    <a href="javascript://" class="deleteall">删除</a>
</span>
</div>
</from>
<script type="text/javascript" charset="utf-8">

$('.arrow').each(function(){
  $(this).parent().popup($(this).parent().next());
});

$(".delete").click(function(){
	  var url = this.href;
		confirm('你确定要删除吗?', function(){
	    location.href = url;
		});
		return false;
});
$('#all').click(function(){
  $('input[name=id[]]').attr('checked', $(this).attr('checked'));
});
$(".deleteall").click(function(){
    $("#comment_manage").submit();
    return false;   
});
</script>
{/block}
